package util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;

public class UrlHelper {
	
	public static void sendUrlGet(String strUrl)
	{
		System.out.println(strUrl);
		 try {
			URL url = new URL(strUrl);
			URLConnection urlConnection = url.openConnection();
			
			BufferedReader in = new BufferedReader(
					new InputStreamReader(urlConnection.getInputStream()));
			String line = null;
			while ((line = in.readLine()) != null)
			{
				System.out.println(line);
			}
			in.close();
			
			//TODO: pas besoin de lire la reponse?
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
